package jane.mvc.actionresults;

import jane.mvc.utils.Utils;

import com.thoughtworks.xstream.XStream;

public class XMLResult extends ActionResult implements IActionResult
{
	public XMLResult(Object content)
	{

		this.setContentType("text/xml");

		XStream xstream = new XStream();

		xstream.alias(new Utils().getClassBaseName(content
				.getClass().getName()), content.getClass());

		this.setContent(xstream.toXML(content));

	}

	@Override
	public String toString()
	{
		return this.getContent().toString();
	}

	@Override
	public boolean isText()
	{
		return true;
	}

}
